<template>
  <div class="loading-container">
    <div class="loading-box">
      <!-- <img class="bg" src="../static/slider/menuBg1.jpg" alt="" /> -->
      <img
        class="logo"
        src="../static/slider/loading.gif"
        v-if="!isNavTo"
        alt=""
      />
    </div>
  </div>
</template>

<script>
export default {
  name: "Loading",
  data() {
    return {
      isNavTo: false,
    };
  },
  mounted() {
    this.loading();
  },
  methods: {
    loading() {
      setTimeout(() => {
        this.isNavTo = true;
        this.$router.push({
          name: "Index",
        });
      }, 4500);
    },
  },
};
</script>

<style lang="scss" scoped>
.loading-container {
  box-sizing: border-box;
  .loading-box {
    background: url("../static/slider/menuBg1.jpg");
    position: relative;
    width: 100vw;
    height: 100vh;
    .bg {
      width: 100%;
      height: 100%;
      z-index: 888;
    }

    .logo {
      width: 25vw;
      height: 28vh;
      position: absolute;
      top: 44vh;
      left: 36.7vw;
      z-index: 999;
    }
  }
}
</style>